package com.jsmile.cloud.msgcenter.web.mq;

import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import com.alibaba.fastjson.JSON;
import com.jsmile.cloud.promotioncenter.api.constants.PromotionConstants;
import com.jsmile.cloud.promotioncenter.api.to.GroupStatusChangeTo;

import lombok.extern.slf4j.Slf4j;

/**
 * 订单状态变化mq
 *
 * @author 亮亮
 * @version 1.0.0
 * @date 2017年3月30日 下午3:34:16
 */
@Component
@Slf4j
public class GroupStatusChangeListener {

    @RabbitListener(queuesToDeclare = @Queue(PromotionConstants.PromotionMq.MSG_GROUP_STATUS_SYNC_QUEUE))
    public void handler(GroupStatusChangeTo groupStatusChangeTo) {
        log.info("拼团状态变化：{}", JSON.toJSONString(groupStatusChangeTo));
    }
}
